# UDP协议 套接字服务端
import socket

# UDP协议=>数据报协议  socket.SOCK_DGRAM
server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server.bind(('127.0.0.1', 8081))

while True:
    data,addr=server.recvfrom(1024)
    print(data.decode('utf-8'))
    server.sendto(data.upper(),addr)

server.close()
